package com.sk.extension.listener;


import com.rabbitmq.client.Channel;
import com.sk.extension.constants.Constant;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.util.Date;


@Component
public class DelayListener {
    @RabbitListener(queues = Constant.DELAY_QUEUE)
    public void delayHandMessage(Message message, Channel channel) throws Exception {
        //消费者逻辑
        System.out.printf("[delay.queue] %tc 接收到消息: %s \n", new Date(), new String(message.getBody(),"UTF-8"));
    }

}
